X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=test%2FCMakeLists.txt;h=4154eb90000d7385ec71cae6960bbcdc3fc77a96;hb=8041dc9f353e4d1bde4a4d48975c69a4f855d7dd;hp=8871312da3016a6c95d911b699f622387461a168;hpb=eab47e7252fe5d3736d3468fb69af06edfce57e3;p=nlopt.git diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8871312..4154eb9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,6 +4,9 @@ add_custom_target (tests) add_executable (testopt testfuncs.c testfuncs.h testopt.c ${PROJECT_SOURCE_DIR}/src/util/timer.c ${PROJECT_SOURCE_DIR}/src/util/mt19937ar.c ${PROJECT_SOURCE_DIR}/src/util/nlopt-getopt.c) target_link_libraries (testopt ${nlopt_lib}) +if (NLOPT_CXX) + set_target_properties(testopt PROPERTIES LINKER_LANGUAGE CXX) +endif () target_include_directories (testopt PRIVATE ${NLOPT_PRIVATE_INCLUDE_DIRS}) add_dependencies (tests testopt) @@ -29,8 +32,8 @@ foreach (algo_index RANGE 29)# 43 set (enable_ FALSE) endif () if (enable_) - add_test (NAME testopt_algo${algo_index}_obj${obj_index} COMMAND testopt -a ${algo_index} -o ${obj_index}) - if (WIN32) + add_test (NAME testopt_algo${algo_index}_obj${obj_index} COMMAND testopt -r 0 -a ${algo_index} -o ${obj_index}) + if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows) set_tests_properties (testopt_algo${algo_index}_obj${obj_index} PROPERTIES ENVIRONMENT "PATH=${PROJECT_BINARY_DIR}\\${CMAKE_BUILD_TYPE};$ENV{PATH}") # to load dll endif () endif ()